<template>
  <div class="footer">
      <ul>
        <router-link to="/home" tag="li">
          <span class="iconfont icon-home"></span>
          <p>首页</p>
        </router-link>
        <router-link to="/kind" tag="li">
          <span class="iconfont icon-kinds"></span>
          <p>分类</p>
        </router-link>
        <router-link to="/cart" tag="li">
          <span class="iconfont icon-cart"></span>
          <p>购物车</p>
        </router-link>
        <router-link to="/my" tag="li" v-if="flag">
          <span class="iconfont icon-wode"></span>
          <p>我的</p>
        </router-link>
        <router-link to="/my" tag="li" v-else>
          <span class="iconfont icon-wode"></span>
          <p>未登录</p>
        </router-link>
      </ul>
    </div>
</template>

<script>
export default {
  data() {
    return {
      flag:true,
    }
  },
  mounted() {
    if(localStorage.getItem("token")){
      this.flag=true;
    }else{
      this.flag=false;
    }
  },
}
</script>

<style>
.footer{
  width: 100%;
  position: fixed;
  left: 0;
  bottom: 0;
}
</style>